package com.fdb.smcts.core.vo;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
 * 
 * 
 * 
 * @author Cytus_
 * @since 2018年5月11日 下午3:45:26
 * @version 1.0
 *
 */
public class PluginVO {
	
	public static final String E_BIZ_SERNO_KEY = "e_bizSerno";
	
	public static final String G_BIZ_SERNO_KEY = "g_bizSerno";
	
	private Map<String, Object> vos;
	
	private FlowInVO flowInVo;
	
	protected String[] keepField = {E_BIZ_SERNO_KEY, G_BIZ_SERNO_KEY};
	
	public PluginVO() {
		this.vos = new HashMap<>();
	}
	
	public void addVOs(String key, Object vo) {
		this.vos.put(key, vo);
	}
	
	public Object getVo(String key) {
		return this.vos.get(key);
	}

	public Map<String, Object> getVos() {
		return this.vos;
	}
	
	public Object remove(String key) {
		if (vos.containsKey(key)) {
			return vos.remove(key);
		}
		return null;
	}
	
	public void putPluginVO(PluginVO vo) {
		if (Objects.isNull(this.vos)) {
			this.vos = new HashMap<String, Object>();
		}
		this.vos.putAll(vo.getVos());
	}

	public FlowInVO getFlowInVo() {
		if (Objects.isNull(this.flowInVo)) {
			this.flowInVo = new FlowInVO();
		}
		return flowInVo;
	}

	public void setFlowInVo(FlowInVO flowInVo) {
		this.flowInVo = flowInVo;
	}
	
}
